import { lazy } from "react";

const Home=lazy(()=>import("../pages/Home"))
const Layout=lazy(()=>import("../pages/Layout"))
const Login=lazy(()=>import("../pages/Login"))
const City=lazy(()=>import("../pages/City"))
const Error=lazy(()=>import("../pages/Error"))
const Text=lazy(()=>import("../pages/Text"))
const User=lazy(()=>import("../pages/User"))

export const handleHomes=[
    {
        path:"/",
        element:<Home></Home>,
        title:"首页"
    },
    {
        path:"/text",
        element:<Text></Text>,
        title:"消息"
    },
    {
        path:"/user",
        element:<User></User>,
        title:"个人中心"
    }
]

export const routes=[
    {
        path:"/",
        element:<Layout></Layout>,
        children:handleHomes
    },
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"*",
        element:<Error></Error>
    },
    {
        path:"/city",
        element:<City></City>
    }
]